export default Array.prototype.myReduce = function (cb, initialVal) {
    let array = this
    let pre = initialVal ? initialVal : (array.length ? array[0] : [])
    for (let i = initialVal ? 0 : 1; i < array.length; i++) {
        pre = cb(pre, array[i], i, array)
    }
    return pre
}